<?php
$q=$_GET["q"];
$con = mysql_connect('localhost', 'feseor5_fese', 'Fs666AdQe');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("feseor5_miportaldev02", $con);
mysql_query("SET NAMES 'utf8'");
$sql="SELECT id_cat_ies, id_nmbNombre FROM cat_ies WHERE id_cat_entidad= '".$q."'";

$result = mysql_query($sql);

echo "<select name='insIES' id='insIES' style='width:380px'>";

while($row = mysql_fetch_array($result))
  {
  echo "<option value=\"".$row['id_cat_ies']."\">".$row['id_nmbNombre'] . "</option>";
  }
echo "</select>";


mysql_close($con);
?>